package com.wx.core.process.message;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wx.commons.ResultConstant;
import com.wx.core.process.BaseProcess;
import com.wx.core.process.BaseResult;
import com.wx.core.process.MsgXmlUtil;
import com.wx.core.process.ProcessResult;
import com.wx.core.process.WxServiceProcess;
import com.wx.core.vo.MsgRequest;
import com.wx.core.vo.MsgResponseText;
import com.wx.core.vo.MsgText;
import com.zyht.common.bean.PropertiesUtilBean.PropertiesUtils;

public class ImageMessageProcess extends BaseProcess {

	
	@Override
	public BaseResult process(HttpServletRequest req, HttpServletResponse res, MsgRequest msgReq) {
		ProcessResult result = new ProcessResult();
		//设置默认回复
		MsgText msgText = new MsgText();
		String defText = PropertiesUtils.getConfig("global_default_text_reply");
		msgText.setContent(defText==null?"欢迎使用！":defText);
		MsgResponseText msgResponseText = WxServiceProcess.getMsgResponseText(msgReq, msgText);
		String xml = MsgXmlUtil.textToXml(msgResponseText);
		result.setResult(xml);
		result.setCode(ResultConstant.SUCCESS);
		return result;
	}

}
